package com.youku.plugins.report.model
{
   import com.youku.interfaces.IReporter;
   import com.youku.interfaces.IPlayerProxy;
   import flash.utils.Timer;
   import flash.net.URLLoader;
   import com.youku.interfaces.IPlayListData;
   import com.youku.PlayerConfig;
   import com.youku.interfaces.IRootData;
   import com.youku.data.PlayerConstant;
   import flash.net.URLVariables;
   import flash.net.URLRequest;
   import flash.net.URLRequestMethod;
   import flash.net.sendToURL;
   import com.youku.events.ReportEvent;
   import com.youku.P2PConfig;
   import com.youku.VersionInfo;
   import com.adobe.json.JSON;
   import flash.system.Capabilities;
   import com.youku.data.LoadTimeData;
   import flash.events.Event;
   import flash.events.IOErrorEvent;
   import flash.events.SecurityErrorEvent;
   import flash.utils.getTimer;
   import flash.utils.ByteArray;
   import flash.events.HTTPStatusEvent;
   import com.dynamicflash.util.Base64;
   import flash.external.ExternalInterface;
   import flash.events.TimerEvent;
   
   public class ReportProxy extends Object implements IReporter
   {
      
      public function ReportProxy(param1:IPlayerProxy) {
         super();
         this._playerProxy = param1;
         this._allReportDatas = new Array();
         var _loc2_:VideoSegmentReportData = new VideoSegmentReportData();
         _loc2_.id = 0;
         this._allReportDatas.push(_loc2_);
         this._testloaderTimer = new Timer(5 * 1000,1);
         this._testloaderTimer.addEventListener(TimerEvent.TIMER_COMPLETE,this.onTestLoaderTimeout);
         this.creatTslogLoader();
         this._isReplay = false;
         this._tslogServerCode = -1;
         this._tslogCacheTime = 0;
         this._isTslogServerRespond = true;
      }
      
      protected var _allReportDatas:Array;
      
      protected var _playerProxy:IPlayerProxy;
      
      private const PASSPORT_LOG_URL:String = "http://passport-log.youku.com/logsys/logstorage/append?";
      
      private var _testloaderTimer:Timer;
      
      private var _testStartTime:Number;
      
      private var _testLoadTime:Number;
      
      private var _TslogLoader:URLLoader;
      
      private var _isReplay:Boolean;
      
      private var _tslogServerCode:int;
      
      private var _tslogCacheTime:int;
      
      private var _isTslogServerRespond:Boolean;
      
      private var _tslogServerDcode:int = 0;
      
      private var _pt:Number = 0;
      
      private var _sn:int = 0;
      
      private var _hi:int = 0;
      
      private var _num:int = 0;
      
      protected function get playlistData() : IPlayListData {
         return PlayerConfig.playListData;
      }
      
      protected function get rootData() : IRootData {
         return PlayerConfig.rootData;
      }
      
      protected function get shouldSendWplayLog() : Boolean {
         if(PlayerConfig.specialType == PlayerConstant.SPECIAL_TYPE_JIETU || PlayerConfig.specialType == PlayerConstant.SPECIAL_TYPE_SHENHE)
         {
            return false;
         }
         return true;
      }
      
      public function createReportData() : void {
         var _loc2_:String = null;
         var _loc3_:* = 0;
         var _loc4_:VideoSegmentReportData = null;
         this._allReportDatas = new Array();
         if(this.playlistData == null || this.playlistData.segArr == null)
         {
            return;
         }
         var _loc1_:* = 0;
         for(_loc2_ in this.playlistData.videoSegmentsDic)
         {
            if(this.playlistData.videoSegmentsDic[_loc2_].length > _loc1_)
            {
               _loc1_ = this.playlistData.videoSegmentsDic[_loc2_].length;
            }
         }
         _loc3_ = 0;
         while(_loc3_ < _loc1_)
         {
            _loc4_ = new VideoSegmentReportData();
            _loc4_.id = _loc3_;
            this._allReportDatas.push(_loc4_);
            _loc3_++;
         }
      }
      
      public function addPlayerStaticReport() : void {
         if(this.playlistData == null)
         {
            return;
         }
         var _loc1_:String = this.rootData.videoId;
         if(_loc1_ == null)
         {
            _loc1_ = "-1";
         }
         if(this.playlistData.vidEncoded != null)
         {
            _loc1_ = this.playlistData.vidEncoded;
         }
         if(this.playlistData.videoId != null)
         {
            _loc1_ = this.playlistData.videoId;
         }
         var _loc2_:URLVariables = new URLVariables();
         _loc2_.videoid = _loc1_;
         _loc2_.sid = this.playlistData.sid;
         _loc2_.source = this.rootData.source;
         _loc2_.referer = this._playerProxy.playerData.referrer == ""?"null":this._playerProxy.playerData.referrer;
         _loc2_.url = this._playerProxy.playerData.href;
         _loc2_.uid = this.playlistData.user.userID;
         _loc2_.totalseg = this.playlistData.segArr.length;
         _loc2_.totalsec = this.playlistData.totalTime;
         _loc2_.fullflag = this.getFullscreenNumber();
         _loc2_.t = this.playlistData.token;
         _loc2_.h = this.playlistData.hashcash;
         var _loc3_:String = this.getIKuFlag();
         _loc3_ = _loc3_ + String(this.getHDFlag() + 1);
         _loc2_.ikuflag = _loc3_;
         var _loc4_:URLRequest = new URLRequest(PlayerConstant.PLAYER_STATIC_REPORT_URL);
         _loc4_.method = URLRequestMethod.POST;
         _loc4_.data = _loc2_;
         sendToURL(_loc4_);
         if(this.rootData.wd != null)
         {
            this.sendBlogLog("1");
         }
      }
      
      public function addPlayerDynamicReport(param1:String, param2:int) : void {
         if(this._allReportDatas == null || this._allReportDatas.length <= 0)
         {
            return;
         }
         if(param2 >= this._allReportDatas.length)
         {
            return;
         }
         var _loc3_:VideoSegmentReportData = this._allReportDatas[param2];
         if(!_loc3_.isCodeCanBeSent(param1))
         {
            return;
         }
         var _loc4_:URLVariables = new URLVariables();
         _loc4_.sid = this.playlistData.sid;
         _loc4_.videoid = this.playlistData.videoId;
         _loc4_.time = this.playlistData.sidTime;
         _loc4_.code = param1;
         _loc4_.starttime = int(this._playerProxy.playerData.getSegmentStatusByNumber(param2).startTime);
         _loc4_.speed = int(this._playerProxy.playerData.getSegmentStatusByNumber(param2).speed);
         _loc4_.segid = param2 + 1;
         var _loc5_:String = this.getIKuFlag();
         _loc5_ = _loc5_ + String(this.getHDFlag() + 1);
         _loc4_.ikuflag = _loc5_;
         if(this.playlistData.show != null)
         {
            _loc4_.userid = this.playlistData.user.userID;
         }
         if(Number(param1) == 3008)
         {
            if(this.rootData.winType == "exterior" || this.rootData.winType == "BDskin")
            {
               this.setlog(2,2);
            }
            this.sendVideoTime({"times":61});
         }
         if(param1 == "3001" && !(this.rootData.partnerId == null) && !(this.rootData.partnerId == ""))
         {
            this.sendflag(0,3);
         }
         if((param1 == "3002" || param1 == "3008") && !(this.rootData.partnerId == null) && !(this.rootData.partnerId == ""))
         {
            this.sendflag(0,4);
         }
         var _loc6_:* = "http://stat.youku.com/player/addPlayerDynamicReport";
         var _loc7_:URLRequest = new URLRequest(_loc6_);
         _loc7_.data = _loc4_;
         _loc7_.method = URLRequestMethod.POST;
         sendToURL(_loc7_);
         _loc3_.codeSent(param1);
         var _loc8_:* = "";
         _loc8_ = _loc8_ + ("time=" + String(_loc4_.time));
         _loc8_ = _loc8_ + ("&code=" + String(_loc4_.code));
         _loc8_ = _loc8_ + ("&videoid=" + String(_loc4_.videoid));
         _loc8_ = _loc8_ + ("&segid=" + String(_loc4_.segid));
         _loc8_ = _loc8_ + ("&starttime=" + String(_loc4_.starttime));
         _loc8_ = _loc8_ + ("&ikuflag=" + String(_loc4_.ikuflag));
         this.sendDynamicUep(String(_loc4_.speed),encodeURIComponent(_loc8_));
      }
      
      public function addWasteReport(param1:int) : void {
         var _loc2_:URLVariables = new URLVariables();
         if(this.getIKuFlag() != "n")
         {
            return;
         }
         _loc2_.sid = this.playlistData.sid;
         _loc2_.videoid = this.playlistData.videoId;
         _loc2_.type = this.playlistData.fileType;
         _loc2_.code = "0000";
         _loc2_.starttime = int(this._playerProxy.playerData.getSegmentStatusByNumber(param1).startTime);
         _loc2_.speed = int(this._playerProxy.playerData.getSegmentStatusByNumber(param1).speed);
         _loc2_.nstime = int(this._playerProxy.playerData.getSegmentStatusByNumber(param1).nsTime);
         _loc2_.loadedtime = int(this._playerProxy.playerData.getSegmentStatusByNumber(param1).loadedTime);
         _loc2_.segid = param1 + 1;
         _loc2_.dmacode = this.playlistData.controller.dma_code;
         _loc2_.areacode = this.playlistData.controller.area_code;
         _loc2_.ikuflag = this.getIKuFlag();
         var _loc3_:* = "http://stat.youku.com/player/addPlayerWasteReport";
         var _loc4_:URLRequest = new URLRequest(_loc3_);
         _loc4_.data = _loc2_;
         _loc4_.method = URLRequestMethod.POST;
         sendToURL(_loc4_);
      }
      
      public function setlog(param1:int, param2:int) : void {
         var _loc3_:* = 0;
         var _loc4_:String = this.rootData.embedId;
         var _loc5_:String = new Date().getTime() + "" + new Date().getMilliseconds() + "" + int(Math.random() * 9000 + 1000);
         var _loc6_:String = "http://player.lstat.youku.com/log.gif?emb=" + _loc4_ + "&t=" + param1 + "&a=" + param2 + "&bd=" + _loc3_ + "&time=" + _loc5_;
         var _loc7_:URLRequest = new URLRequest(_loc6_);
         sendToURL(_loc7_);
      }
      
      public function newlog() : void {
         var _loc1_:URLVariables = new URLVariables();
         _loc1_.vid = this.playlistData.videoId;
         _loc1_.rnd = new Date().getTime() + int(Math.random() * 100000);
         _loc1_.t = 3;
         var _loc2_:* = "http://valst.lstat.youku.com/log.gif";
         var _loc3_:URLRequest = new URLRequest(_loc2_);
         _loc3_.data = _loc1_;
         sendToURL(_loc3_);
      }
      
      public function sendflag(param1:int, param2:int) : void {
         var _loc3_:URLVariables = new URLVariables();
         _loc3_.tp = param1;
         _loc3_.pid = this.rootData.partnerId;
         _loc3_.flag = param2;
         _loc3_.vid = this.rootData.videoId;
         var _loc4_:* = "http://hz.youku.com/outsiteapi.php";
         var _loc5_:URLRequest = new URLRequest(_loc4_);
         _loc5_.data = _loc3_;
         _loc5_.method = URLRequestMethod.POST;
         sendToURL(_loc5_);
      }
      
      public function sendDroppedFrame(param1:Object) : void {
         var _loc2_:URLVariables = this.getBasicParams();
         _loc2_.t = "qos";
         _loc2_.x = "";
         var param1:Object = {};
         param1.udfs = this._playerProxy.playerData.droppedFramesDifference;
         _loc2_.a = this.getBase64String(param1);
         var _loc3_:* = "http://e.stat.youku.com/vt/vt";
         var _loc4_:URLRequest = new URLRequest(_loc3_);
         _loc4_.data = _loc2_;
         _loc4_.method = URLRequestMethod.POST;
         sendToURL(_loc4_);
      }
      
      public function sendPlayErrorReport(param1:ReportEvent) : void {
         if(param1 == null || param1.type == null)
         {
            return;
         }
         var _loc2_:* = this.PASSPORT_LOG_URL + "project=playerror&log=";
         var _loc3_:Object = new Object();
         _loc3_.partner = P2PConfig.InitP2PType;
         _loc3_.version = VersionInfo.ver();
         _loc3_.type = param1.data.type;
         _loc3_.code = param1.data.code;
         if((this.playlistData) && (this.playlistData.videoId) && (this.playlistData.controller))
         {
            _loc3_.vid = this.playlistData.videoId;
            _loc3_.dma = this.playlistData.controller.dma_code;
            _loc3_.area = this.playlistData.controller.area_code;
         }
         _loc2_ = _loc2_ + com.adobe.json.JSON.encode(_loc3_);
         var _loc4_:URLRequest = new URLRequest(_loc2_);
         _loc4_.method = URLRequestMethod.GET;
         sendToURL(_loc4_);
      }
      
      public function sendLoadTimeEvent(param1:ReportEvent) : void {
         if(param1 == null || param1.type == null)
         {
            return;
         }
         var _loc2_:String = this.playlistData.sid.substr(-2);
         var _loc3_:int = int(_loc2_);
         if(_loc3_ % 100 != 50)
         {
            return;
         }
         var _loc4_:* = this.PASSPORT_LOG_URL + "project=playerloadtime&log=";
         var _loc5_:Object = {};
         _loc5_.type = param1.data.type;
         _loc5_.stage = param1.data.stage;
         _loc5_.info = param1.data.info;
         _loc5_.sid = this.playlistData.sid;
         _loc5_.area = this.playlistData.controller?this.playlistData.controller.area_code:"";
         _loc5_.dma = this.playlistData.controller?this.playlistData.controller.dma_code:"";
         _loc5_.partner = P2PConfig.InitP2PType;
         _loc5_.ikuflag = this.getIKuFlag();
         _loc5_.v = Capabilities.version;
         _loc5_.report = new Object();
         _loc5_.report.ltplayer = int(PlayerConfig.loadtimeData.ltplayer);
         _loc5_.report.ltplaypolicy = int(PlayerConfig.loadtimeData.ltplaypolicy);
         _loc5_.report.ltgetplaylist = int(PlayerConfig.loadtimeData.ltgetplaylist);
         _loc5_.report.ltvideoview = int(PlayerConfig.loadtimeData.ltvideoview);
         _loc5_.report.ltadview = int(PlayerConfig.loadtimeData.ltadview);
         _loc5_.report.ltadrequest = int(PlayerConfig.loadtimeData.ltadrequest);
         _loc4_ = _loc4_ + com.adobe.json.JSON.encode(_loc5_);
         var _loc6_:URLRequest = new URLRequest(_loc4_);
         _loc6_.method = URLRequestMethod.GET;
         sendToURL(_loc6_);
         this.testLoadTime();
      }
      
      public function sendLoadTimeReport(param1:Boolean, param2:String, param3:String) : void {
         var _loc7_:String = null;
         var _loc8_:String = null;
         var _loc9_:String = null;
         var _loc10_:* = false;
         if(!param1)
         {
            _loc10_ = this.checkSendLoadTime(param2);
            if(PlayerConfig.rootData.pvid == null || PlayerConfig.rootData.pvid == "" || PlayerConfig.rootData.uepflag == false || _loc10_ == true)
            {
               return;
            }
         }
         var _loc4_:* = "http://v.l.youku.com/uep?";
         var _loc5_:* = "flashplayer";
         if(P2PConfig.InitP2PType == "ss")
         {
            _loc5_ = "ssplayer";
         }
         else if(P2PConfig.InitP2PType == "ppweb")
         {
            _loc5_ = "ppwebplayer";
         }
         else if(P2PConfig.InitP2PType == "youku-p2p")
         {
            _loc5_ = "p2pplayer";
         }
         
         
         _loc4_ = _loc4_ + ("m=" + _loc5_);
         _loc4_ = _loc4_ + ("&u=" + encodeURIComponent(this._playerProxy.playerData.href));
         if((this.playlistData) && !(param2 == LoadTimeData.TYPE_GETPLAYLIST))
         {
            _loc4_ = _loc4_ + ("&v=" + this.playlistData.sid);
            _loc4_ = _loc4_ + ("&ct=" + this.playlistData.ct);
            _loc4_ = _loc4_ + ("&cs=" + this.playlistData.cs);
            _loc4_ = _loc4_ + ("&hd=" + String(this.getHDFlag()));
            _loc4_ = _loc4_ + ("&a=" + this.playlistData.controller.area_code + "|" + this.playlistData.controller.dma_code);
         }
         var _loc6_:String = param2;
         if(_loc6_ == LoadTimeData.TYPE_CRAZY)
         {
            _loc7_ = String(PlayerConfig.loadtimeData.ltcrazy);
            _loc8_ = String(PlayerConfig.loadtimeData.ltcrazy_start);
            _loc9_ = String(PlayerConfig.loadtimeData.ltcrazy_end);
            PlayerConfig.loadtimeData.ltcrazy_isSend = true;
            PlayerConfig.loadtimeData.ltstartplay = Number(_loc7_);
            PlayerConfig.loadtimeData.ltstartplay_start = Number(_loc8_);
            PlayerConfig.loadtimeData.ltstartplay_end = Number(_loc9_);
         }
         else if(_loc6_ == LoadTimeData.TYPE_AD)
         {
            _loc7_ = String(PlayerConfig.loadtimeData.ltadview);
            _loc8_ = String(PlayerConfig.loadtimeData.ltadview_start);
            _loc9_ = String(PlayerConfig.loadtimeData.ltadview_end);
            PlayerConfig.loadtimeData.ltadview_isSend = true;
            PlayerConfig.loadtimeData.ltstartplay = Number(_loc7_);
            PlayerConfig.loadtimeData.ltstartplay_start = Number(_loc8_);
            PlayerConfig.loadtimeData.ltstartplay_end = Number(_loc9_);
         }
         else if(_loc6_ == LoadTimeData.TYPE_VIDEO)
         {
            _loc7_ = String(PlayerConfig.loadtimeData.ltvideoview);
            _loc8_ = String(PlayerConfig.loadtimeData.ltvideoview_start);
            _loc9_ = String(PlayerConfig.loadtimeData.ltvideoview_end);
            PlayerConfig.loadtimeData.ltvideoview_isSend = true;
            PlayerConfig.loadtimeData.ltstartplay = Number(_loc7_);
            PlayerConfig.loadtimeData.ltstartplay_start = Number(_loc8_);
            PlayerConfig.loadtimeData.ltstartplay_end = Number(_loc9_);
         }
         else if(_loc6_ == LoadTimeData.TYPE_GETPLAYLIST)
         {
            _loc7_ = String(PlayerConfig.loadtimeData.ltgetplaylist);
            _loc8_ = String(PlayerConfig.loadtimeData.ltgetplaylist_start);
            _loc9_ = String(PlayerConfig.loadtimeData.ltgetplaylist_end);
            PlayerConfig.loadtimeData.ltgetplaylist_isSend = true;
         }
         else if(_loc6_ == LoadTimeData.TYPE_AD_FRONT_REQUEST)
         {
            _loc7_ = String(PlayerConfig.loadtimeData.ltadrequest);
            _loc8_ = String(PlayerConfig.loadtimeData.ltadrequest_start);
            _loc9_ = String(PlayerConfig.loadtimeData.ltadrequest_end);
            PlayerConfig.loadtimeData.ltadrequest_isSend = true;
         }
         else if(_loc6_ == LoadTimeData.TYPE_CDN)
         {
            _loc7_ = String(int(PlayerConfig.loadtimeData.ltcdn));
            _loc8_ = String(PlayerConfig.loadtimeData.ltcdn_start);
            _loc9_ = String(PlayerConfig.loadtimeData.ltcdn_end);
            PlayerConfig.loadtimeData.ltcdn_isSend = true;
         }
         else if(_loc6_ == LoadTimeData.TYPE_SRART_PLAY)
         {
            _loc7_ = String(PlayerConfig.loadtimeData.ltstartplay);
            _loc8_ = String(PlayerConfig.loadtimeData.ltstartplay_start);
            _loc9_ = String(PlayerConfig.loadtimeData.ltstartplay_end);
            PlayerConfig.loadtimeData.ltstartplay_isSend = true;
         }
         else if(_loc6_ == LoadTimeData.TYPE_BUFFER)
         {
            _loc7_ = String(PlayerConfig.loadtimeData.ltbuffer);
            _loc8_ = String(PlayerConfig.loadtimeData.ltbuffer_start);
            _loc9_ = String(PlayerConfig.loadtimeData.ltbuffer_end);
         }
         
         
         
         
         
         
         
         if(param1)
         {
            _loc7_ = "-1";
         }
         _loc4_ = _loc4_ + ("&t=" + _loc6_);
         _loc4_ = _loc4_ + ("&s=" + _loc7_);
         _loc4_ = _loc4_ + ("&st=" + _loc8_);
         _loc4_ = _loc4_ + ("&et=" + _loc9_);
         if(!(PlayerConfig.rootData.pvid == null) && !(PlayerConfig.rootData.pvid == ""))
         {
            _loc4_ = _loc4_ + ("&pid=" + PlayerConfig.rootData.pvid);
         }
         if(param3 != null)
         {
            _loc4_ = _loc4_ + ("&e=" + param3);
         }
         if(_loc6_ == LoadTimeData.TYPE_SRART_PLAY)
         {
            _loc4_ = _loc4_ + ("&ext=" + encodeURIComponent("p2pStatus=" + PlayerConfig.p2pStatus));
         }
         sendToURL(new URLRequest(_loc4_));
         if(_loc6_ == LoadTimeData.TYPE_AD || _loc6_ == LoadTimeData.TYPE_VIDEO || _loc6_ == LoadTimeData.TYPE_CRAZY)
         {
            this.sendLoadTimeReport(false,LoadTimeData.TYPE_SRART_PLAY,null);
         }
      }
      
      private function sendDynamicUep(param1:String, param2:String) : void {
         if(PlayerConfig.rootData.pvid == null || PlayerConfig.rootData.pvid == "" || PlayerConfig.rootData.uepflag == false)
         {
            return;
         }
         var _loc3_:* = "http://v.l.youku.com/uep?";
         var _loc4_:* = "flashplayer";
         if(P2PConfig.InitP2PType == "ss")
         {
            _loc4_ = "ssplayer";
         }
         else if(P2PConfig.InitP2PType == "ppweb")
         {
            _loc4_ = "ppwebplayer";
         }
         else if(P2PConfig.InitP2PType == "youku-p2p")
         {
            _loc4_ = "p2pplayer";
         }
         
         
         _loc3_ = _loc3_ + ("m=" + _loc4_);
         _loc3_ = _loc3_ + ("&u=" + encodeURIComponent(this._playerProxy.playerData.href));
         _loc3_ = _loc3_ + ("&v=" + this.playlistData.sid);
         _loc3_ = _loc3_ + ("&ct=" + this.playlistData.ct);
         _loc3_ = _loc3_ + ("&cs=" + this.playlistData.cs);
         _loc3_ = _loc3_ + ("&hd=" + String(this.getHDFlag()));
         _loc3_ = _loc3_ + ("&a=" + this.playlistData.controller.area_code + "|" + this.playlistData.controller.dma_code);
         _loc3_ = _loc3_ + ("&t=" + LoadTimeData.TYPE_CDN);
         _loc3_ = _loc3_ + ("&pid=" + PlayerConfig.rootData.pvid);
         _loc3_ = _loc3_ + ("&s=" + param1);
         _loc3_ = _loc3_ + ("&ext=" + param2);
         sendToURL(new URLRequest(_loc3_));
      }
      
      private function checkSendLoadTime(param1:String) : Boolean {
         var _loc2_:* = false;
         if(param1 == LoadTimeData.TYPE_AD)
         {
            _loc2_ = PlayerConfig.loadtimeData.ltadview_isSend;
         }
         else if(param1 == LoadTimeData.TYPE_VIDEO)
         {
            _loc2_ = PlayerConfig.loadtimeData.ltvideoview_isSend;
         }
         else if(param1 == LoadTimeData.TYPE_GETPLAYLIST)
         {
            _loc2_ = PlayerConfig.loadtimeData.ltgetplaylist_isSend;
         }
         else if(param1 == LoadTimeData.TYPE_AD_FRONT_REQUEST)
         {
            _loc2_ = PlayerConfig.loadtimeData.ltadrequest_isSend;
         }
         else if(param1 == LoadTimeData.TYPE_CDN)
         {
            _loc2_ = PlayerConfig.loadtimeData.ltcdn_isSend;
         }
         else if(param1 == LoadTimeData.TYPE_SRART_PLAY)
         {
            _loc2_ = PlayerConfig.loadtimeData.ltstartplay_isSend;
         }
         else if(param1 == LoadTimeData.TYPE_CRAZY)
         {
            _loc2_ = PlayerConfig.loadtimeData.ltcrazy_isSend;
         }
         else if(param1 == LoadTimeData.TYPE_BUFFER)
         {
            _loc2_ = false;
         }
         
         
         
         
         
         
         
         return _loc2_;
      }
      
      private function testLoadTime() : void {
         var _loc1_:* = "http://yk.pp.navi.youku.com/noneclass";
         var _loc2_:URLLoader = new URLLoader();
         _loc2_.addEventListener(Event.COMPLETE,this.onTestLoaderComplete);
         _loc2_.addEventListener(IOErrorEvent.IO_ERROR,this.onTestLoaderError);
         _loc2_.addEventListener(SecurityErrorEvent.SECURITY_ERROR,this.onTestLoaderError);
         _loc2_.load(new URLRequest(_loc1_));
         this._testStartTime = getTimer();
         this._testloaderTimer.stop();
         this._testloaderTimer.start();
      }
      
      private function onTestLoaderTimeout(param1:Event) : void {
         this._testloaderTimer.stop();
         this._testLoadTime = getTimer() - this._testStartTime;
         this.sendTestLoadTimeEvent("timeout");
      }
      
      private function onTestLoaderError(param1:Event) : void {
         this._testloaderTimer.stop();
         this._testLoadTime = getTimer() - this._testStartTime;
         this.sendTestLoadTimeEvent("error");
      }
      
      private function onTestLoaderComplete(param1:Event) : void {
         this._testloaderTimer.stop();
         this._testLoadTime = getTimer() - this._testStartTime;
         this.sendTestLoadTimeEvent("report");
      }
      
      private function sendTestLoadTimeEvent(param1:String) : void {
         var _loc2_:* = this.PASSPORT_LOG_URL + "project=playerloadtime&log=";
         var _loc3_:Object = {};
         _loc3_.type = param1;
         _loc3_.stage = "stage_testnavi";
         _loc3_.sid = this.playlistData.sid;
         _loc3_.area = this.playlistData.controller?this.playlistData.controller.area_code:"";
         _loc3_.dma = this.playlistData.controller?this.playlistData.controller.dma_code:"";
         _loc3_.partner = P2PConfig.InitP2PType;
         _loc3_.ikuflag = this.getIKuFlag();
         _loc3_.report = new Object();
         _loc3_.report.lttestnavi = this._testLoadTime;
         _loc2_ = _loc2_ + com.adobe.json.JSON.encode(_loc3_);
         var _loc4_:URLRequest = new URLRequest(_loc2_);
         _loc4_.method = URLRequestMethod.GET;
         sendToURL(_loc4_);
      }
      
      public function sendPlayVVReport(param1:ReportEvent) : void {
         if(param1 == null || param1.type == null)
         {
            return;
         }
         var _loc2_:* = this.PASSPORT_LOG_URL + "project=playvv&log=";
         var _loc3_:Object = new Object();
         _loc3_.partner = P2PConfig.InitP2PType;
         _loc3_.vid = this.playlistData.videoId;
         _loc3_.sid = this.playlistData.sid;
         _loc3_.version = VersionInfo.ver();
         _loc3_.dma = this.playlistData.controller.dma_code;
         _loc3_.area = this.playlistData.controller.area_code;
         switch(param1.type)
         {
            case ReportEvent.CORE_INIT_EVENT:
               _loc3_.type = "coreinit";
               break;
            case ReportEvent.PLAY_POLICY_ALLOW:
               if(!(param1.data == null) && !(param1.data.allow == null))
               {
                  _loc3_.allow = param1.data.allow;
               }
               _loc3_.type = "allowp2p";
               break;
            case ReportEvent.PLAYVV_IKU:
               _loc3_.type = "iku";
               break;
            case ReportEvent.LOAD_P2P_SWC:
               _loc3_.type = "loadp2p";
               break;
            case ReportEvent.REAL_USE_P2P:
               _loc3_.type = "realusep2p";
               break;
            case ReportEvent.NOT_REAL_USE_P2P:
               _loc3_.type = "notrealusep2p";
               break;
            case ReportEvent.P2P_SOCKET_FAIL:
               _loc3_.type = "socketfail";
               _loc3_.error = param1.data == null?"":param1.data.error;
               break;
         }
         _loc2_ = _loc2_ + com.adobe.json.JSON.encode(_loc3_);
         var _loc4_:URLRequest = new URLRequest(_loc2_);
         _loc4_.method = URLRequestMethod.GET;
         sendToURL(_loc4_);
      }
      
      public function sendInvalidEventReport(param1:Object) : void {
         param1.ikuflag = this.getIKuFlag();
         param1.vid = this.playlistData.videoId;
         param1.sid = this.playlistData.sid;
         param1.dma = this.playlistData.controller.dma_code;
         param1.area = this.playlistData.controller.area_code;
         param1.partner = P2PConfig.InitP2PType;
         param1.version = Capabilities.version;
         var _loc2_:* = this.PASSPORT_LOG_URL + "project=invalid_play_event&log=";
         _loc2_ = _loc2_ + com.adobe.json.JSON.encode(param1);
         var _loc3_:URLRequest = new URLRequest(_loc2_);
         _loc3_.method = URLRequestMethod.GET;
         sendToURL(_loc3_);
      }
      
      public function sendDelayTimeLog(param1:Number) : void {
         var _loc2_:URLVariables = this.getBasicParams();
         _loc2_.t = "rdt";
         _loc2_.x = "";
         var _loc3_:Object = {};
         _loc3_.dt = param1;
         _loc2_.a = this.getBase64String(_loc3_);
         var _loc4_:* = "http://e.stat.youku.com/vt/vt";
         var _loc5_:URLRequest = new URLRequest(_loc4_);
         _loc5_.method = URLRequestMethod.POST;
         _loc5_.data = _loc2_;
         sendToURL(_loc5_);
      }
      
      private function getBasicParams() : URLVariables {
         var _loc1_:URLVariables = new URLVariables();
         _loc1_.sid = this.playlistData.sid;
         _loc1_.vid = this.playlistData.videoId;
         _loc1_.ct = this.playlistData.ct;
         _loc1_.cs = this.playlistData.cs;
         _loc1_.hd = this.playlistData.fileType;
         _loc1_.ig = this.getIKuFlag();
         _loc1_.dc = this.playlistData.controller.dma_code;
         _loc1_.ac = this.playlistData.controller.area_code;
         return _loc1_;
      }
      
      public function sendP2PLog(param1:Object) : void {
         var _loc2_:URLVariables = new URLVariables();
         _loc2_.sid = this.playlistData.sid;
         _loc2_.vid = this.playlistData.videoId;
         _loc2_.hd = this.getHDFlag();
         _loc2_.number = param1.times;
         _loc2_.partner = P2PConfig.InitP2PType;
         _loc2_.ikuflag = this.getIKuFlag();
         _loc2_.p2p = P2PConfig.isP2PRunning;
         _loc2_.bytes = P2PStat.diffBytes();
         _loc2_.ext = Math.ceil(Math.random() * 1000000);
         var _loc3_:* = "http://v.l.ykimg.com/ykp2pplayervt";
         var _loc4_:URLRequest = new URLRequest(_loc3_);
         _loc4_.data = _loc2_;
         _loc4_.method = URLRequestMethod.GET;
         sendToURL(_loc4_);
      }
      
      public function sendVideoTime(param1:Object) : void {
         var _loc3_:* = false;
         var _loc4_:String = null;
         var _loc5_:* = 0;
         var _loc6_:URLLoader = null;
         var _loc7_:String = null;
         var _loc8_:URLRequest = null;
         if(PlayerConfig.isTudouPlayer)
         {
            return;
         }
         if(param1.times == 5)
         {
            if(!this._isReplay)
            {
               _loc3_ = this.checkTSLogTimes();
               if(_loc3_)
               {
                  this.checkTSLogServerTimeout();
                  this.sendTSLog(60);
               }
            }
            this._isReplay = false;
         }
         if(param1.times == 59)
         {
            this.sendVVLog(59);
         }
         if(param1.times == 62)
         {
            this.sendVVLog(62);
            this.resetTsLogParam();
         }
         if(param1.times == 61)
         {
            this.sendTSLog(61);
         }
         if(param1.times == 5)
         {
            return;
         }
         if(P2PConfig.InitP2PType == "ppweb")
         {
            if(param1.times == 59)
            {
               this.sendP2PLog(param1);
            }
         }
         else if(P2PConfig.InitP2PType == "ss")
         {
            this.sendP2PLog(param1);
         }
         
         if(param1.times == 60)
         {
            _loc4_ = this.playlistData.sid.substr(-2);
            _loc5_ = int(_loc4_);
            if(_loc5_ % 100 == 50)
            {
               this.sendDroppedFrame(param1);
            }
         }
         if(param1.times == 59)
         {
            this.scorecardresearch();
         }
         if(param1.times == 59)
         {
            if(this.rootData.winType == "exterior" || this.rootData.winType == "BDskin")
            {
               this.setlog(2,1);
            }
         }
         if(param1.times == 61 && (PlayerConfig.isTaobaoPlayer))
         {
            _loc6_ = new URLLoader();
            _loc6_.load(new URLRequest("http://hz.youku.com/outsiteshare.php?spid=1&type=3"));
         }
         var _loc2_:URLVariables = new URLVariables();
         _loc2_.sid = this.playlistData.sid;
         _loc2_.videoOwnerId = this.playlistData.userId;
         _loc2_.viewUserId = this.playlistData.user.userID;
         _loc2_.videoid = this.playlistData.videoId;
         _loc2_.ct = this.playlistData.ct;
         _loc2_.cs = this.playlistData.cs;
         if(String(this.playlistData.tags).indexOf("09两会") != -1)
         {
            _loc2_.cs = _loc2_.cs + "|10001";
         }
         _loc2_.number = param1.times;
         _loc2_.source = this.rootData.source;
         _loc2_.rnd = getTimer();
         _loc2_.guid = this._playerProxy.playerData.GUID;
         if(this.playlistData.show != null)
         {
            _loc2_.showid_v2 = this.playlistData.show == null?"":this.playlistData.show.showID;
            _loc2_.showid_v3 = this.playlistData.show == null?"":this.playlistData.show.showidEncode;
            _loc2_.show_videotype = this.playlistData.show.showVideoType;
            _loc2_.stg = this.playlistData.show.stage;
         }
         else
         {
            _loc2_.showid_v2 = "";
         }
         if(this.getTypeNumber() == 1)
         {
            _loc2_.fid = this.rootData.fid;
            _loc2_.fob = this.rootData.ob;
            _loc2_.fpo = this.rootData.pt;
         }
         if(this.playlistData.show != null)
         {
            _loc2_.Tid = this.playlistData.show.theaterID;
         }
         else
         {
            _loc2_.Tid = 0;
         }
         if(this.playlistData.show != null)
         {
            _loc2_.Copyright = this.playlistData.show.copyright;
         }
         _loc2_.hd = this.getHDFlag();
         _loc2_.format = this.getMaxFileType();
         _loc2_.Type = this.getTypeNumber();
         _loc2_.winType = this.getWinTypeNumber();
         _loc2_.totalsec = this.playlistData.totalTime;
         _loc2_.ikuflag = this.getIKuFlag();
         if(this._playerProxy.playerData.IKuId != "")
         {
            _loc2_.ikuid = this._playerProxy.playerData.IKuId;
         }
         _loc2_.fullflag = this.getFullscreenNumber();
         _loc2_.playComplete = 0;
         if(param1.times == 61)
         {
            _loc2_.playComplete = 1;
         }
         if(param1.times == 59)
         {
            _loc2_.referUrl = this._playerProxy.playerData.referrer == ""?"null":this._playerProxy.playerData.referrer;
            _loc2_.url = this._playerProxy.playerData.href;
            if(this.rootData.embedId)
            {
               _loc2_.emb = this.rootData.embedId;
            }
            _loc2_.starttime = int(param1.starttime);
         }
         _loc2_.currentPlayTime = this._playerProxy.playerData.videoNsTime;
         if(param1.times == 59)
         {
            _loc2_.currentPlayTime = PlayerConfig.startPosition;
         }
         _loc2_.continuationPlay = this._playerProxy.playerData.isContinuous?1:0;
         _loc2_.timestamp = new Date().getTime();
         _loc2_.topHdVideo = this.playlistData.sourceVid;
         _loc2_.pid = this.rootData.partnerId;
         if(PlayerConfig.isTaobaoPlayer)
         {
            _loc2_.isp = "1";
            _loc2_.pid = "XMTI=";
         }
         _loc2_.mtype = this.getMType();
         if(PlayerConfig.isTudouPlayer)
         {
            _loc2_.td = 1;
         }
         if(this._playerProxy.playerData.playlistCurrentLangID != null)
         {
            _loc2_.langid = this._playerProxy.playerData.playlistCurrentLangID;
         }
         if(this._playerProxy.rootGetData.rootPvid != null)
         {
            _loc2_.pvid = this._playerProxy.rootGetData.rootPvid;
         }
         if(this._playerProxy.rootGetData.rootUnCookie != null)
         {
            _loc2_.unCookie = this._playerProxy.rootGetData.rootUnCookie;
         }
         if(this._playerProxy.rootGetData.rootFrame != null)
         {
            _loc2_.frame = this._playerProxy.rootGetData.rootFrame;
         }
         _loc2_.ctype = PlayerConstant.CTYPE;
         _loc2_.ev = PlayerConstant.EV;
         _loc2_.tk = this.playlistData.tk;
         _loc2_.oip = this.playlistData.oip;
         if(!(_loc2_.number == 0) && !PlayerConfig.isTudouPlayer)
         {
            _loc7_ = "http://stat.youku.com/player/addPlayerDurationReport";
            _loc8_ = new URLRequest(_loc7_);
            _loc8_.data = _loc2_;
            _loc8_.method = URLRequestMethod.GET;
            sendToURL(_loc8_);
         }
         if(this.rootData.wd != null)
         {
            if(param1.times == 59)
            {
               this.sendBlogLog("2");
            }
            if(param1.times == 60 && this.playlistData.controller.area_code == "110000")
            {
               this.sendBlogLog("3");
            }
            if(param1.times == 61)
            {
               this.sendBlogLog("4");
            }
         }
      }
      
      private function sendVVLog(param1:Number) : void {
         var _loc2_:URLVariables = new URLVariables();
         _loc2_.pvid = this._playerProxy.rootGetData.rootPvid == null?"":this._playerProxy.rootGetData.rootPvid;
         _loc2_.chid = this.playlistData.ct == null?"":this.playlistData.ct;
         _loc2_.url = this._playerProxy.playerData.href;
         _loc2_.rurl = this._playerProxy.playerData.referrer == ""?"":this._playerProxy.playerData.referrer;
         _loc2_.vvid = this.playlistData.sid;
         _loc2_.vid = this.playlistData.videoId == null?"":this.playlistData.videoId;
         _loc2_.schid = this.playlistData.cs == null?"":this.playlistData.cs;
         _loc2_.plid = this.rootData.fid == null?"":this.rootData.fid;
         _loc2_.plchid = this.rootData.plchid == null?"":this.rootData.plchid;
         _loc2_.shid = this.playlistData.show == null?"":this.playlistData.show.showID;
         _loc2_.shchid = this.playlistData.ct == null?"":this.playlistData.ct;
         _loc2_.ptype = this.getWinTypeNumber();
         _loc2_.cp = this.playlistData.show == null?"":String(this.playlistData.show.copyright);
         _loc2_.vl = this._playerProxy.playerData.playlistTotalTime;
         _loc2_.cf = this.getHDFlag();
         _loc2_.hf = this.getMaxFileType();
         _loc2_.spt = PlayerConfig.startPosition;
         _loc2_.pb = this.getPlayByType(param1);
         _loc2_.vdoid = this.playlistData.userId;
         _loc2_.out = this.getWinTypeNumber() < 3?0:1;
         _loc2_.ext = this.getExtString(param1);
         _loc2_.r = this.sign(_loc2_.vvid + _loc2_.vid);
         var _loc3_:* = "http://v.l.youku.com/ykvvlog?";
         var _loc4_:URLRequest = new URLRequest(_loc3_);
         _loc4_.data = _loc2_;
         _loc4_.method = URLRequestMethod.GET;
         sendToURL(_loc4_);
      }
      
      protected function getExtString(param1:Number) : String {
         var _loc2_:* = "";
         if(this.rootData.vext)
         {
            _loc2_ = _loc2_ + (this.rootData.vext + "&");
         }
         _loc2_ = _loc2_ + ("iku=" + this.getIKuFlag());
         _loc2_ = _loc2_ + ("&full=" + String(this.getFullscreenNumber()));
         _loc2_ = _loc2_ + ("&lang=" + String(this._playerProxy.playerData.playlistCurrentLangID == null?1:this._playerProxy.playerData.playlistCurrentLangID));
         _loc2_ = _loc2_ + ("&num=" + String(param1));
         _loc2_ = _loc2_ + ("&ctp=" + String(this.rootData.continuous?1:0));
         _loc2_ = _loc2_ + ("&pc=" + "0");
         _loc2_ = _loc2_ + "&clb=0";
         _loc2_ = _loc2_ + ("&ctype=" + PlayerConstant.CTYPE);
         _loc2_ = _loc2_ + ("&ev=" + PlayerConstant.EV);
         _loc2_ = _loc2_ + ("&tk=" + this.playlistData.tk);
         _loc2_ = _loc2_ + ("&oip=" + this.playlistData.oip);
         return _loc2_;
      }
      
      private function sendTSLog(param1:Number) : void {
         var _loc2_:URLVariables = new URLVariables();
         _loc2_.vvid = this.playlistData.sid;
         _loc2_.vid = this.playlistData.videoId == null?"":this.playlistData.videoId;
         _loc2_.cf = this.getHDFlag();
         _loc2_.cpt = String(Math.round(this._playerProxy.playerData.videoNsTime));
         _loc2_.pt = String(this._pt);
         _loc2_.sn = String(this._sn);
         _loc2_.hi = String(this._hi);
         _loc2_.r = this.sign(_loc2_.vvid + _loc2_.vid + _loc2_.cpt + _loc2_.pt + _loc2_.sn);
         _loc2_.full = String(this.getFullscreenNumber());
         _loc2_.lang = String(this._playerProxy.playerData.playlistCurrentLangID == null?1:this._playerProxy.playerData.playlistCurrentLangID);
         _loc2_.ctp = String(this.rootData.continuous?1:0);
         _loc2_.pc = String(param1 == 60?0:1);
         _loc2_.iku = this.getIKuFlag();
         _loc2_.uid = this.playlistData.user.userID;
         var _loc3_:* = "http://p-log.ykimg.com/tslog?";
         var _loc4_:URLRequest = new URLRequest();
         _loc4_.data = _loc2_;
         _loc4_.method = URLRequestMethod.GET;
         _loc4_.url = _loc3_;
         this._tslogCacheTime = getTimer();
         this._isTslogServerRespond = false;
         this._TslogLoader.load(_loc4_);
      }
      
      private function checkTSLogTimes() : Boolean {
         var _loc1_:* = false;
         this._num++;
         this._pt = this._num * 5;
         if(this._num <= 12)
         {
            this._hi = 5;
         }
         else if(this._num <= 36)
         {
            this._hi = 10;
         }
         else
         {
            this._hi = 20;
         }
         
         _loc1_ = this._pt % this._hi == 0;
         if(_loc1_)
         {
            this._sn++;
         }
         return _loc1_;
      }
      
      private function resetTsLogParam() : void {
         this._pt = 0;
         this._sn = 0;
         this._hi = 0;
         this._num = 0;
      }
      
      private function checkTSLogServerTimeout() : void {
         if(!this._isTslogServerRespond)
         {
            this._tslogServerDcode = 901;
            this._TslogLoader.close();
            this.creatTslogLoader();
            this.sendTslogError();
            this._isTslogServerRespond = true;
         }
      }
      
      private function sign(param1:String) : int {
         var _loc4_:* = 0;
         var _loc5_:ByteArray = null;
         var _loc6_:* = 0;
         var _loc2_:* = 0;
         var _loc3_:int = param1.length;
         if(_loc2_ == 0 && _loc3_ > 0)
         {
            _loc4_ = 0;
            _loc5_ = new ByteArray();
            _loc5_.writeUTF(param1);
            _loc6_ = 0;
            while(_loc6_ < _loc3_)
            {
               _loc2_ = 43 * _loc2_ + _loc5_[_loc4_++];
               _loc6_++;
            }
         }
         return _loc2_;
      }
      
      private function sendTslogError() : void {
         var _loc1_:String = this.playlistData.sid.substr(-2);
         var _loc2_:int = int(_loc1_);
         if(_loc2_ % 100 != 50)
         {
            return;
         }
         var _loc3_:* = "http://p.l.ykimg.com/ykvisitts?";
         _loc3_ = _loc3_ + ("vid=" + String(this.playlistData.videoId == null?"":this.playlistData.videoId));
         _loc3_ = _loc3_ + ("&vvid=" + String(this.playlistData.sid));
         _loc3_ = _loc3_ + ("&code=" + String(this._tslogServerCode == -1?0:this._tslogServerCode));
         _loc3_ = _loc3_ + ("&cost=" + String(getTimer() - this._tslogCacheTime));
         _loc3_ = _loc3_ + ("&dcode=" + String(this._tslogServerDcode));
         sendToURL(new URLRequest(_loc3_));
         this._tslogServerCode = -1;
      }
      
      private function onTslogComplete(param1:Event) : void {
         if(getTimer() - this._tslogCacheTime > 4000)
         {
            this._tslogServerDcode = 902;
            this.sendTslogError();
         }
         this._isTslogServerRespond = true;
      }
      
      private function onTslogServerCode(param1:HTTPStatusEvent) : void {
         this._tslogServerCode = param1.status;
         if(this._tslogServerCode != 200)
         {
            this._tslogServerDcode = 900;
         }
         this._isTslogServerRespond = true;
      }
      
      private function creatTslogLoader() : void {
         this._TslogLoader = new URLLoader();
         this._TslogLoader.addEventListener(Event.COMPLETE,this.onTslogComplete);
         this._TslogLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,this.onTslogSecurityError);
         this._TslogLoader.addEventListener(IOErrorEvent.IO_ERROR,this.onTslogIOError);
         this._TslogLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS,this.onTslogServerCode);
      }
      
      private function onTslogSecurityError(param1:SecurityErrorEvent) : void {
         this._tslogServerDcode = 100;
         this.onTslogError();
      }
      
      private function onTslogIOError(param1:IOErrorEvent) : void {
         this._tslogServerDcode = 101;
         this.onTslogError();
      }
      
      private function onTslogError() : void {
         this._tslogServerCode = -1;
         this.sendTslogError();
         this._isTslogServerRespond = true;
      }
      
      public function sendWplaylog() : void {
         if(!this.shouldSendWplayLog)
         {
            return;
         }
         var _loc1_:URLVariables = new URLVariables();
         _loc1_.vid = this.playlistData.videoId;
         if((this.rootData.extstring) && !(this.rootData.extstring == ""))
         {
            _loc1_.extstring = this.rootData.extstring;
         }
         var _loc2_:* = "http://v.youku.com/player/wplaylog/";
         var _loc3_:URLRequest = new URLRequest(_loc2_);
         _loc3_.data = _loc1_;
         _loc3_.method = URLRequestMethod.GET;
         sendToURL(_loc3_);
      }
      
      public function sendIKuStatus() : void {
         var _loc1_:URLVariables = new URLVariables();
         _loc1_.sid = this.playlistData.sid;
         _loc1_.videoid = this.playlistData.videoId;
         var _loc2_:* = "http://127.0.0.1:8909/stat";
         var _loc3_:URLRequest = new URLRequest(_loc2_);
         _loc3_.data = _loc1_;
         _loc3_.method = URLRequestMethod.GET;
         var _loc4_:URLLoader = new URLLoader(_loc3_);
         _loc4_.addEventListener(IOErrorEvent.IO_ERROR,this.onLoaderError);
         _loc4_.addEventListener(SecurityErrorEvent.SECURITY_ERROR,this.onLoaderError);
         _loc4_.load(_loc3_);
      }
      
      public function sendReplay() : void {
         this._isReplay = true;
         this.scorecardresearch();
         this.sendVideoTime({"times":62});
         var _loc1_:URLVariables = new URLVariables();
         _loc1_.sid = this.playlistData.sid;
         _loc1_.videoid = this.getVideoId();
         _loc1_.source = this.rootData.source;
         _loc1_.url = this._playerProxy.playerData.href;
         _loc1_.referer = this._playerProxy.playerData.referrer == ""?"null":this._playerProxy.playerData.referrer;
         _loc1_.uid = this.playlistData.user.userID;
         _loc1_.ikuflag = this.getIKuFlag();
         _loc1_.fullflag = this.getFullscreenNumber();
         var _loc2_:* = "http://stat.youku.com/player/addPlayerStaticReport";
         var _loc3_:URLRequest = new URLRequest(_loc2_);
         _loc3_.data = _loc1_;
         _loc3_.method = URLRequestMethod.POST;
         sendToURL(_loc3_);
      }
      
      public function scorecardresearch() : void {
         if(PlayerConfig.isTudouPlayer)
         {
            return;
         }
         if(PlayerConfig.isIkuPlayer)
         {
            return;
         }
         var _loc1_:* = "1";
         var _loc2_:* = "7293931";
         var _loc3_:* = "";
         var _loc4_:* = "";
         var _loc5_:* = "";
         var _loc6_:String = String(PlayerConfig.playListData.categories);
         var _loc7_:String = new Array("c1=",_loc1_,"&c2=",_loc2_,"&c3=",_loc3_,"&c4=",_loc4_,"&c5=",_loc5_,"&c6=",_loc6_).join("");
         var _loc8_:String = "http://b.scorecardresearch.com/b?" + _loc7_;
         sendToURL(new URLRequest(_loc8_));
      }
      
      public function sendFullScreen() : void {
         var _loc1_:URLVariables = new URLVariables();
         _loc1_.guid = this._playerProxy.playerData.GUID;
         _loc1_.ct = this.playlistData.ct;
         _loc1_.cs = this.playlistData.cs;
         _loc1_.videoid = this.playlistData.videoId;
         _loc1_.type = this.getTypeNumber();
         _loc1_.winType = this.getWinTypeNumber();
         _loc1_.fullflag = this.getFullscreenNumber();
         _loc1_.rand = int(Math.random() * 99999);
         var _loc2_:* = "http://lstat.youku.com/fullscreen.php";
         var _loc3_:URLRequest = new URLRequest(_loc2_);
         _loc3_.data = _loc1_;
         _loc3_.method = URLRequestMethod.GET;
         sendToURL(_loc3_);
      }
      
      public function sendUserActionLog(param1:String, param2:String, param3:Object = null) : void {
         var _loc8_:String = null;
         var _loc4_:Object = new Object();
         _loc4_.v = VersionInfo.ver();
         _loc4_.vid = this.getVideoId();
         _loc4_.uid = this.playlistData.user == null?0:this.playlistData.user.userID;
         _loc4_.ssid = this.playlistData.sid;
         _loc4_.fid = this.rootData.fid;
         _loc4_.sid = this.playlistData.show == null?"":this.playlistData.show.showID;
         _loc4_.ct = this.playlistData.ct;
         _loc4_.cs = this.playlistData.cs;
         _loc4_.tc = this._playerProxy.playerData.videoCurrentNsTime;
         _loc4_.ver = "1.0.0";
         if(param3 != null)
         {
            for(_loc8_ in param3)
            {
               _loc4_[_loc8_] = param3[_loc8_];
            }
         }
         var _loc5_:Object = new Object();
         _loc5_.wt = this.rootData.winType;
         _loc5_.f = this.getFullscreenNumber() == 0?"off":"on";
         _loc5_.q = this.playlistData.fileType;
         _loc5_.l = this.rootData.light;
         _loc5_.w = this.rootData.THX;
         var _loc6_:* = "http://p-log.ykimg.com/event?";
         _loc6_ = _loc6_ + "t=1001";
         _loc6_ = _loc6_ + ("&e=" + param1);
         _loc6_ = _loc6_ + ("&v=" + param2);
         _loc6_ = _loc6_ + ("&d=" + this.getBase64String(_loc5_));
         _loc6_ = _loc6_ + ("&x=" + this.getBase64String(_loc4_));
         var _loc7_:URLRequest = new URLRequest(_loc6_);
         _loc7_.method = URLRequestMethod.GET;
         sendToURL(_loc7_);
      }
      
      public function sendADBlockNoticeLog(param1:String, param2:Number, param3:Boolean, param4:Number = -1) : void {
         var _loc5_:URLVariables = new URLVariables();
         _loc5_.guid = this._playerProxy.playerData.GUID;
         _loc5_.vid = this.playlistData.videoId;
         _loc5_.uid = this.playlistData.user.userID;
         _loc5_.ts = new Date().getTime();
         _loc5_.time = param2;
         _loc5_.type = param1;
         _loc5_.fa = param3;
         if(param4 != -1)
         {
            _loc5_.last = param4;
         }
         var _loc6_:* = "http://hz.youku.com/red/ggnotice.php";
         var _loc7_:URLRequest = new URLRequest(_loc6_);
         _loc7_.data = _loc5_;
         _loc7_.method = URLRequestMethod.GET;
         sendToURL(_loc7_);
      }
      
      public function sendADBlockReport(param1:int, param2:int) : void {
         var _loc3_:* = "http://bc.youku.com/rs.html?";
         _loc3_ = _loc3_ + ("st=" + param1);
         _loc3_ = _loc3_ + ("&bt=" + param2);
         _loc3_ = _loc3_ + ("&sid=" + this.playlistData.sid);
         _loc3_ = _loc3_ + ("&vid=" + this.playlistData.videoId);
         _loc3_ = _loc3_ + ("&dc=" + this.playlistData.controller.dma_code);
         _loc3_ = _loc3_ + ("&ac=" + this.playlistData.controller.area_code);
         _loc3_ = _loc3_ + ("&ct=" + this.playlistData.ct);
         _loc3_ = _loc3_ + ("&cs=" + this.playlistData.cs);
         _loc3_ = _loc3_ + ("&os=" + Capabilities.os);
         _loc3_ = _loc3_ + ("&wintype=" + this._playerProxy.rootGetData.rootWinType);
         if((this._playerProxy.playerData.userData) && (this._playerProxy.playerData.userData.vip))
         {
            _loc3_ = _loc3_ + ("&vip=" + 1);
         }
         else
         {
            _loc3_ = _loc3_ + ("&vip=" + 0);
         }
         if((this.playlistData.show) && (this.playlistData.show.isVideoPaid))
         {
            _loc3_ = _loc3_ + ("&pid=" + 1);
         }
         else
         {
            _loc3_ = _loc3_ + ("&pid=" + 0);
         }
         sendToURL(new URLRequest(_loc3_));
      }
      
      public function sendSpeedLog(param1:Array, param2:String, param3:String) : void {
         var _loc4_:String = PlayerConfig.GUID;
         var _loc5_:ByteArray = new ByteArray();
         _loc5_.writeObject(param1);
         var _loc6_:String = Base64.encodeByteArray(_loc5_);
         var _loc7_:* = "http://hz.youku.com/red/playerDownloadSpeedStat.php?";
         _loc7_ = _loc7_ + ("g=" + _loc4_);
         _loc7_ = _loc7_ + ("&s=" + _loc6_);
         _loc7_ = _loc7_ + ("&it=" + param2);
         _loc7_ = _loc7_ + ("&ft=" + param3);
         sendToURL(new URLRequest(_loc7_));
      }
      
      public function sendEndcardLog(param1:String) : void {
         var _loc2_:String = this._playerProxy.playerData.videoIdEncode;
         var _loc3_:* = "0";
         if(this.playlistData.show)
         {
            _loc3_ = String(this.playlistData.show.showID);
         }
         var _loc4_:String = "http://r.l.youku.com/recclick?" + param1 + "&" + "vid=" + _loc2_ + "&" + "sid=" + _loc3_;
         sendToURL(new URLRequest(_loc4_));
      }
      
      public function sendBlogLog(param1:String) : void {
         var _loc2_:URLVariables = new URLVariables();
         _loc2_.type = param1;
         _loc2_.vid = this.playlistData.videoId;
         _loc2_.sid = this.playlistData.sid;
         _loc2_.ct = this.playlistData.ct;
         _loc2_.cs = this.playlistData.cs;
         _loc2_.embedid = Base64.encode(this.rootData.embedId);
         _loc2_.wd = this.rootData.wd;
         var _loc3_:* = "http://e.stat.youku.com/wbjc/log";
         var _loc4_:URLRequest = new URLRequest(_loc3_);
         _loc4_.data = _loc2_;
         _loc4_.method = URLRequestMethod.GET;
         sendToURL(_loc4_);
      }
      
      public function sendJumpUrlErrorLog(param1:String) : void {
         var _loc2_:URLVariables = new URLVariables();
         _loc2_.type = "";
         _loc2_.vid = this.playlistData.videoId;
         _loc2_.url = this._playerProxy.playerData.href;
         _loc2_.emb = this.rootData.embedId;
         _loc2_.info = param1;
         var _loc3_:* = "http://e.stat.ykimg.com/outside_back/outside_back";
         var _loc4_:URLRequest = new URLRequest(_loc3_);
         _loc4_.data = _loc2_;
         _loc4_.method = URLRequestMethod.GET;
         sendToURL(_loc4_);
      }
      
      public function sendPartnerConsume(param1:String) : void {
         sendToURL(new URLRequest("https://openapi.youku.com/v2/players/consume.json?token=" + param1));
      }
      
      protected function getBase64String(param1:Object) : String {
         var _loc4_:String = null;
         var _loc5_:String = null;
         if(param1 == null)
         {
            return "";
         }
         var _loc2_:ByteArray = new ByteArray();
         var _loc3_:* = "";
         for(_loc4_ in param1)
         {
            _loc3_ = _loc3_ + (_loc4_ + "=" + param1[_loc4_] + "&");
         }
         _loc3_ = _loc3_.slice(0,-1);
         _loc5_ = Base64.encode(_loc3_);
         return _loc5_;
      }
      
      protected function getVideoId() : String {
         var _loc1_:String = this.rootData.videoId;
         if(this.playlistData.videoId != null)
         {
            _loc1_ = this.playlistData.videoId;
         }
         return _loc1_;
      }
      
      protected function getIsVideoPaid() : int {
         if(this.playlistData.show != null)
         {
            return this.playlistData.show.isVideoPaid;
         }
         return 0;
      }
      
      protected function getIKuFlag() : String {
         var _loc1_:* = "";
         if(this._playerProxy.playerData.isIKuInstall)
         {
            _loc1_ = "y";
         }
         else if(P2PConfig.isP2PRunning)
         {
            _loc1_ = P2PConfig.p2pFlag;
         }
         else
         {
            _loc1_ = "n";
         }
         
         if(PlayerConfig.isRTMP)
         {
            _loc1_ = "r";
         }
         if(PlayerConfig.isTudouPlayer)
         {
            _loc1_ = "tp";
         }
         if(PlayerConfig.isIkuPlayer)
         {
            _loc1_ = "ip";
         }
         return _loc1_;
      }
      
      protected function getMType() : String {
         var _loc3_:String = null;
         var _loc4_:String = null;
         var _loc1_:String = null;
         try
         {
            _loc1_ = ExternalInterface.call("function(){ return navigator.userAgent;}");
         }
         catch(e:Error)
         {
         }
         if(_loc1_ == null)
         {
            _loc1_ = "";
         }
         var _loc2_:Object = 
            {
               "iph":"iPhone",
               "ipa":"iPad",
               "ipo":"iPod",
               "adr":"Android"
            };
         for(_loc3_ in _loc2_)
         {
            _loc4_ = _loc2_[_loc3_];
            if(_loc1_.indexOf(_loc4_) != -1)
            {
               return _loc3_;
            }
         }
         return "oth";
      }
      
      protected function getHDFlag() : int {
         var _loc1_:* = 0;
         if(this.playlistData.fileType == "flv" || this.playlistData.fileType == "flvhd")
         {
            _loc1_ = 0;
         }
         else if(this.playlistData.fileType == "mp4")
         {
            _loc1_ = 1;
         }
         else if(this.playlistData.fileType == "hd2")
         {
            _loc1_ = 2;
         }
         else if(this.playlistData.fileType == "hd3")
         {
            _loc1_ = 3;
         }
         
         
         
         return _loc1_;
      }
      
      protected function getMaxFileType() : int {
         var _loc1_:* = 0;
         if(this.playlistData.hasHD)
         {
            _loc1_ = 2;
         }
         else if(this.playlistData.hasMid)
         {
            _loc1_ = 1;
         }
         
         return _loc1_;
      }
      
      protected function getPlayByType(param1:Number) : int {
         var _loc2_:* = 0;
         if(param1 == 62)
         {
            _loc2_ = 2;
         }
         if(this.rootData.pb != 0)
         {
            _loc2_ = this.rootData.pb;
         }
         return _loc2_;
      }
      
      protected function getFullscreenNumber() : Number {
         var _loc1_:Number = 0;
         if(this._playerProxy.playerData.isInFullScreen)
         {
            _loc1_ = 1;
         }
         else
         {
            _loc1_ = 0;
         }
         return _loc1_;
      }
      
      protected function getTypeNumber() : Number {
         var _loc1_:Number = 0;
         if(this.rootData.type == "Folder")
         {
            _loc1_ = 1;
         }
         else
         {
            _loc1_ = 0;
         }
         return _loc1_;
      }
      
      protected function getWinTypeNumber() : Number {
         var _loc1_:Number = 0;
         if(this.rootData.winType == "index")
         {
            _loc1_ = 0;
         }
         else if(this.rootData.winType == "interior")
         {
            _loc1_ = 1;
         }
         else if(this.rootData.winType == "adshow")
         {
            _loc1_ = 2;
         }
         else if(this.rootData.winType == "BDskin")
         {
            _loc1_ = 3;
         }
         else if(this.rootData.winType == "exterior")
         {
            _loc1_ = 4;
         }
         else if(this.rootData.winType == "touch")
         {
            _loc1_ = 10;
         }
         else if(this.rootData.winType == "tudoupartner")
         {
            _loc1_ = 20;
         }
         else if(this.rootData.winType == "ikupartner")
         {
            _loc1_ = 21;
         }
         
         
         
         
         
         
         
         return _loc1_;
      }
      
      protected function onLoaderError(param1:Event) : void {
      }
   }
}
